import { ajax } from '../http.js';

const goodsDatailUrl = '/product/view';
const byProductIdUrl = '/product_sku/find_list_by_product_id';
const saveCartUrl = '/authc/cart/save_cart';
const findDetaildataUrl = '/weixin/wechat_share';


const goodsDatail = (data, success, fail) =>// 商品详情
  ajax({
    url: goodsDatailUrl,
    data: data,
    noAuth: true,
    success: success,
    fail: fail
  });

const byProductId = (data, success, fail) =>// 商品规格
  ajax({
    url: byProductIdUrl,
    data: data,
    noAuth: true,
    success: success,
    fail: fail
  });

const saveCart = (data, success, fail) =>// 加入购物车
  ajax({
    url: saveCartUrl,
    data: data,
    success: success,
    fail: fail
  });

const findDetaildata = (data, success, fail) =>// 微信分享
  ajax({
    url: findDetaildataUrl,
    data: data,
    success: success,
    fail: fail
  });


export {
  goodsDatail,
  byProductId,
  saveCart,
  findDetaildata
}